import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './styles/element-variables.scss';
import 'normalize.css/normalize.css';
import './utils/rem.js'; // 引入REM设置
import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';
import { basAssetsUrl } from '@/utils/baseConfig'

Vue.use(ElementUI);

dayjs.extend(duration);
// 将dayjs添加到Vue原型链上
Vue.prototype.$dayjs = dayjs;
Vue.prototype.$basAssetsUrl = basAssetsUrl;
Vue.prototype.$bus = new Vue();

Vue.config.productionTip = false

Vue.prototype.$getImageUrl = function(url) {
  if (!url) return require('@/assets/footerBg.png');
  return url.includes('http') ? url : basAssetsUrl + url;
};

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
